home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / lib / c / syscall / sun4.md / RCS / userSysCallInt.h,v < prev   
Encoding:
Text File  |  1989-06-16  |  2.8 KB  |  123 lines

  1. head     1.3;
  2. branch   ;
  3. access   ;
  4. symbols  ;
  5. locks    ; strict;
  6. comment  @ * @;
  7.  
  8.  
  9. 1.3
  10. date     89.05.09.23.14.46;  author rab;  state Exp;
  11. branches ;
  12. next     1.2;
  13.  
  14. 1.2
  15. date     89.03.26.20.20.29;  author mgbaker;  state Exp;
  16. branches ;
  17. next     1.1;
  18.  
  19. 1.1
  20. date     89.03.17.23.44.10;  author mgbaker;  state Exp;
  21. branches ;
  22. next     ;
  23.  
  24.  
  25. desc
  26. @Syscall preamble for the sun4.
  27. @
  28.  
  29.  
  30. 1.3
  31. log
  32. @Fixed macro to work with gnu cpp.
  33. @
  34. text
  35. @/*
  36.  * userSysCallInt.h --
  37.  *
  38.  *     Contains macro for stubs for user-level system calls.
  39.  *
  40.  * Copyright 1985, 1988 Regents of the University of California
  41.  * Permission to use, copy, modify, and distribute this
  42.  * software and its documentation for any purpose and without
  43.  * fee is hereby granted, provided that the above copyright
  44.  * notice appear in all copies.  The University of California
  45.  * makes no representations about the suitability of this
  46.  * software for any purpose.  It is provided "as is" without
  47.  * express or implied warranty.
  48.  *
  49.  * rcs = $Header: /sprite/src/lib/c/syscall/sun4.md/RCS/userSysCallInt.h,v 1.2 89/03/26 20:20:29 mgbaker Exp Locker: rab $ SPRITE (Berkeley)
  50.  */
  51.  
  52. #include "kernel/sysSysCall.h"
  53. #include "kernel/machConst.h"
  54. #ifndef _USERSYSCALLINT
  55. #define _USERSYSCALLINT
  56. /*
  57.  * ----------------------------------------------------------------------------
  58.  *
  59.  * SYS_CALL --
  60.  *
  61.  *      Define a user-level system call.  The call sets up a trap into a 
  62.  *    system-level routine with the appropriate constant passed as
  63.  *     an argument to specify the type of system call.
  64.  *
  65.  *    1) Put constant into global register %g1.  This is what sun OS does,
  66.  *    so the compiler and C library have agreed it's okay to trash g1 when
  67.  *    taking a system call.
  68.  *    2) Execute a software trap instruction.  Arguments to the trap
  69.  *    are left in the output registers, since this is a leaf routine, and
  70.  *    they will become the input registers to the trap window.
  71.  *    3) The return value is left in %o0, since this is a leaf routine,
  72.  *    and it will be found correctly in %o0 by our caller.
  73.  *
  74.  * ----------------------------------------------------------------------------
  75.  */
  76.  
  77. #ifdef __STDC__
  78. #define SYS_CALL(name, constant)    \
  79.     .globl _ ## name; _ ## name:    \
  80.     set    constant, %g1;        \
  81.     ta MACH_SYSCALL_TRAP;         \
  82.     retl;                \
  83.     nop
  84. #else
  85. #define SYS_CALL(name, constant)    \
  86.     .globl _/**/name; _/**/name:    \
  87.     set    constant, %g1;        \
  88.     ta MACH_SYSCALL_TRAP;         \
  89.     retl;                \
  90.     nop
  91. #endif
  92. #endif /* _USERSYSCALLINT */
  93. @
  94.  
  95.  
  96. 1.2
  97. log
  98. @Seventeenth Kernel.  It executes its first system call: Sys_Shutdown().
  99. @
  100. text
  101. @d15 1
  102. a15 1
  103.  * rcs = $Header: /sprite/src/lib/c/syscall/sun4.md/RCS/userSysCallInt.h,v 1.1 89/03/17 23:44:10 mgbaker Exp Locker: mgbaker $ SPRITE (Berkeley)
  104. d43 1
  105. d45 7
  106. d57 2
  107. a58 2
  108.  
  109. #endif _USERSYSCALLINT
  110. @
  111.  
  112.  
  113. 1.1
  114. log
  115. @Initial revision
  116. @
  117. text
  118. @d15 1
  119. a15 1
  120.  * rcs = $Header: userSysCallInt.h,v 1.1 88/06/19 14:30:08 ouster Exp $ SPRITE (Berkeley)
  121. d19 1
  122. @
  123.